package com.byjk.ai.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OllamaConfig {

    @Bean
    public ChatClient chatClient(OllamaChatModel ollamaClient) {
       return  ChatClient.builder(ollamaClient)
               .defaultSystem("你是个小助手，名字叫小阳，你是个会说话的机器人，你会回答问题，你会回答问题")
               .defaultAdvisors(new SimpleLoggerAdvisor())// 日志打印
               .build();
    }
}
